package com.gitee.somenvm.ninerpgitem.core.resolver.parser

import com.gitee.somenvm.ninerpgitem.core.resolver.Context
import com.gitee.somenvm.ninerpgitem.core.resolver.PlaceholderResolver

/**
 * 使用方法 如
 * {root:custom1}
 * 感觉没啥必要
 */
object ParserRoot : PlaceholderResolver {
    override val id = "root"
    override fun resolve(source: String, placeholder: String, context: Context): List<String> {
        val tmp = context.nineItem.root[placeholder]
        return listOf(source.replace(restore(placeholder), tmp.toString()))
    }

}